package pers.gxm.state;

public class LunchState implements State{

    private static LunchState lunchState = new LunchState();
    private LunchState(){}

    public static LunchState getInstance(){
        return lunchState;
    }
    @Override
    public void doClock(Context context, int hour) {
        if(hour < 8 || hour > 20){
            context.changeState(NightState.getInstance());
            return;
        }
        if(hour >=8 && hour < 12 || hour > 12 && hour <= 20){
            context.changeState(DayState.getInstance());
        }
    }

    @Override
    public void doUse(Context context) {
//        System.out.println("警告，午餐时间使用金库!");
        context.callSecurityCenter("警告，午餐时间使用金库!");
    }

    @Override
    public void doAlarm(Context context) {
//        System.out.println("警告，午餐时间按下警铃!");
        context.callSecurityCenter("警告，午餐时间按下警铃!");
    }

    @Override
    public void doPhone(Context context) {
//        System.out.println("离岗吃午饭，请留言");
        context.recording("离岗吃午饭，请留言");
    }
}
